﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" 
  Inherits="System.Web.Mvc.ViewPage<Colaboradores.Models.Cls_ListaCargo>" %>


<asp:Content ID="cargoTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Cargo
</asp:Content>

<asp:Content ID="cargoContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Cargo</h2>
    <%= Html.ActionLink("Cadastrar Novo Cargo", "Novo", "Cargo") %>
    <br /> <br />
    <% using (Html.BeginForm()) {%>
        <fieldset>
            <h3>Pesquisar</h3>
            
            <%= Html.RadioButton("Tipo", "Cod", true) %> Código
            <%= Html.RadioButton("Tipo", "Dsc", false) %> Descrição <br />
            <%= Html.TextBox("Pesquisa")%> <br />
            <p>
                <input type="submit" value="Pesquisar" />
            </p>
        </fieldset>
    <% } %>

    <h3> <%= ViewData["Pesquisa"] %> </h3>

    <table>
        <tr>
            <th>Código</th>
            <th>Descrição</th>
            <th>Alterar</th>
            <th>Excluir</th>
        </tr>
        <% foreach (var cargo in Model.lstCargo){ %>
            <tr>
                <td><%= cargo.Cod %></td>
                <td><%= cargo.Dsc %></td>
                <td><%= Html.ActionLink("Alterar", "Alterar", cargo) %></td>
                <td><%= Html.ActionLink("Excluir", "Excluir", cargo) %></td>
            </tr>
        <%} %>
    </table>
</asp:Content>